Dynamic Reporting

Workshop at the UZH Reproducibility Day 2023

Samuel Pawel and Felix Hofmann

Center for Reproducible Science (CRS)

Overview



  1. What is dynamic reporting?

  2. How to do dynamic reporting?

  3. Hands-on exercises

Manual reporting workflow

What are the disadvantages?



  • Tedious and error-prone
  • Not directly reproducible
  • Difficult to share/reuse
  • New data → need to repeat everything



Dynamic reporting workflow

Which tool for whom?


  • knitrR+LaTeX users (intermediate to advanced)
  • R MarkdownR users (beginner to advanced)
  • QuartoR/Python/Julia users (beginner to advanced)

Exercises


  1. Download the data sets on traffic accidents in Zurich from https://github.crsuzh/dynamicReporting/workshop/.

  2. Explore the data from the 2020 (file accidents_2020.csv) . Compute the number of accidents for each weekday and visualize your results. Create an HTML report using either R Markdown or Quarto.

  3. Now use the data from 2020 and 2021 (file accidents_2021.csv) and create an updated report.

  4. Bonus: Convert your report to a presentation.

Backup: R Markdown

  • R programming language
    (> 60 other also possible)

  • .Rmd files (edit in RStudio, VS Code, etc.)

  • Markup language: Markdown

  • HTML, PDF, DOCX output formats (and more)

  • rmarkdown is an R package

Backup: knitr

  • Programming language: R
    (> 60 other also possible)

  • .Rnw files (edit in RStudio, VS Code, etc.)

  • Markup languages: LaTeX
    (+ HTML, Markdown, and more)

  • PDF output format (and more)

  • knitr is an R package

Backup: Quarto

  • Programming language: R, Python, Julia

  • .qmd files (edit in RStudio, VS Code, etc.)

  • Markup language: Markdown

  • HTML, PDF, DOCX output formats (and more)

  • Evolution of R Markdown (introduced in 2022)

  • quarto is a separate program